const puppeteer = require('puppeteer');
const fs = require('fs');

(async () => {
    const html = fs.readFileSync('rendered.html', 'utf-8');
    const browser = await puppeteer.launch({ headless: "new" });
    const page = await browser.newPage();

    await page.setContent(html, { waitUntil: 'networkidle0' });
    await page.setViewport({ width: 800, height: 600 });
    await page.screenshot({ path: 'order.png', fullPage: true });

    await browser.close();
})();
